package com.zhny.sensor.dao;

import com.zhny.sensor.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Auther: zhy
 * @Date: 2019/11/9
 * @Description: 用戶数据管理
 */
public interface UserRespontity extends JpaRepository<User, String> {
    List<User> findByIdCard(String idCard);

    @Query(value = "SELECT * from sys_user where idCard = ?1 or wechatCodeDecode = ?2",nativeQuery = true)
    List<User> queryUsers(String idCard, String wechatCodeDecode);
}
